* lisp/progmodes/ruby-mode.el (ruby-toggle-block): Guess the current block,
authorDmitry Gutov <dgutov@yandex.ru>
Sat, 8 Sep 2012 23:32:25 +0000 (03:32 +0400)
committerDmitry Gutov <dgutov@yandex.ru>
Sat, 8 Sep 2012 23:32:25 +0000 (03:32 +0400)
commite4a1ddddbbef8a67ecea645a95ff6ce428aa1400
treee3e9dbe2d6286112c8297ca1e4ead3b5151b8c25
parenta5e689a19c099a8f5600572bd0a35b379779b61b
* lisp/progmodes/ruby-mode.el (ruby-toggle-block): Guess the current block,
not just expect to be at its beginning.  Adjust callees.
Succeed when do-end block has no space before the pipe character.
(ruby-brace-to-do-end): When the original block is one-liner,
convert to multiline.  Reindent the result.

* test/automated/ruby-mode-tests.el:
(ruby-toggle-block-to-multiline): New test.
(ruby-should-indent-buffer, ruby-toggle-block-to-do-end)
(ruby-toggle-block-to-brace): Use buffer-string.
lisp/ChangeLog
lisp/progmodes/ruby-mode.el
test/ChangeLog
test/automated/ruby-mode-tests.el